package com.ruoyi.consumer.controller.wallet.walletOperationFactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DeductionStrategyFactory {

    @Autowired
    private IndividualUserStrategy individualUserStrategy;

    @Autowired
    private CorporateUserStrategy corporateUserStrategy;

    public DeductionStrategy getStrategy(String userType) {
        if ("1".equals(userType)) {
            return individualUserStrategy;
        } else if ("2".equals(userType)) {
            return corporateUserStrategy;
        } else {
            throw new IllegalArgumentException("Unknown user type: " + userType);
        }
    }
}
